package com.tf.integrated.entity;

/**
 * 
 *
 * @date 2020-09-15 09:52:39
 */
public class SearchDataReturnEntity<Entity>
{
	private int code;
	private int total;
	private Entity list;

	public SearchDataReturnEntity() {
		this.code = 0;
	}

	public SearchDataReturnEntity(int code, int total) {
		this.code = code;
	}

	public SearchDataReturnEntity(Entity entity) {
		this();
		this.list = entity;
	}

	public SearchDataReturnEntity<Entity> ok(Entity entity) {
		this.list = entity;
		return this;
	}

	public SearchDataReturnEntity<Entity> ok(Entity entity, int code, int total) {
		this.code = code;
		this.total = total;
		this.list = entity;
		return this;
	}

	public SearchDataReturnEntity<Entity> ok() {
		return this;
	}

	public SearchDataReturnEntity<Entity> error(String message)
	{
		return new SearchDataReturnEntity(0, 0);
	}

	public SearchDataReturnEntity<Entity> put(Entity entity)
	{
		this.list = entity;
		return this;
	}

	public int getCode() {
		return this.code;
	}

	public Entity getList() {
		return this.list;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public void setList(Entity list) {
		this.list = list;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}
}
